<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

	<h:head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	</h:head>
	
	<h:body>

		<h1><h:outputText value="Cadastrar Novo Cliente"/></h1>

		<h:form id="formCadastraCliente">

			<br />

			<h:inputHidden value="#{clienteBean.cliente.id}" />

			<p:panelGrid columns="2">

				<f:facet name="header">  
			        Digite as informações do Cliente
			    </f:facet>

				<br />
				<h:outputLabel value="" />

				<h:outputLabel value="Nome:" for="nome" />
				<p:inputText id="nome" label="Nome"
					value="#{clienteBean.cliente.nome}" size="25" maxlength="40">
				</p:inputText>		

				<h:outputLabel value="CPF:" for="cpf" />
				<p:inputMask id="cpf" label="Cpf" value="#{clienteBean.cliente.cpf}"
					mask="999.999.999-99" size="25" maxlength="11">
				</p:inputMask>
				
				<h:outputLabel value="Endereço" for="endereco" />
				<p:inputText id="endereco" label="Endereço"
					value="#{clienteBean.cliente.endereco}" size="25" maxlength="50">
				</p:inputText>

				<h:outputLabel value="Cidade" for="cidade" />
				<p:inputText id="cidade" label="Cidade"
					value="#{clienteBean.cliente.cidade}" size="25" maxlength="50">
				</p:inputText>

				<h:outputText value="UF: " />
				<p:selectOneMenu value="#{clienteBean.cliente.uf}">
					<f:selectItem itemLabel="" itemValue="" />
					<f:selectItems value="#{clienteBean.listauf}" />
				</p:selectOneMenu>


			</p:panelGrid>

			<br />

			<p:commandButton id="btnSalvar"
				actionListener="#{clienteBean.gravar()}" value="Salvar"
				icon="ui-icon-check" ajax="false" />

			<p:commandButton id="btnLimpar"
				actionListener="#{clienteBean.limparCampos}" value="Limpar"
				icon="ui-icon-trash" style="margin-left: 10px;" ajax="true"
				update="@form" />

		</h:form>
	</h:body>

</html>